home *** CD-ROM | disk | FTP | other *** search
- ' This simple macro gathers layer names for an entire drawing.
- '
- ' It first asks the user for the name of an output file,
- ' then creates that file. Next it cycles through the drawing,
- ' and writes all the Layer names to the open ASCII text file,
- ' reporting the number of names written when finished.
- '
- ' This version only checks the first 50 layers, (1-50, Not 0), but
- ' you can change the value of Count on the line below to add layers
- ' to the output. Count can be changed to values between 1 and 255.
- Count = 50
- '
- ' Get Output filename from user
- Input "Output filename? (remember to add .TXT)", Outfile$
- '
- ' Truncate numbers to the right of the decimal.
- Precision 0
- '
- ' Open the Data file, it's created in whatever directory the macro is in
- open "o", 1, Outfile$
- ' Loop for Layers 1-50
- for a = 1 to Count
- ' Set the Current Layer to a
- Sys(3) = a
- ' Check for Layer Name
- if SYS$(93) = "" then
- goto NextLoop
- else
- LayName$ = Sys$(93)
- print #1, LayName$
- b = b + 1
- end if
- ' Loop for next layer
- NextLoop:
- next a
- ' Remember to close the file
- Close #1
- ' Display Results
- Message b, " Layer Names written to ",Outfile$
- End
-